<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<!--标准mui.css-->
		<link rel="stylesheet" href="css/mui.min.css">
		<!--App自定义的css-->
		<!--<link rel="stylesheet" type="text/css" href="../css/app.css"/>-->
		<style>
			p {
				text-indent: 22px;
				padding: 5px 8px;
			}
			html,body,.mui-content {
				background-color: #fff;
			}
			h4 {
				margin-left: 5px;
			}
		</style>
	</head>
	<body>
		 <header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">详细内容</h1>
		</header> 
		<div class="mui-content">
			<div class="mui-content-padded">
				   <h4 id="detailTitle" style="text-align: center;">title</h4>
					<p id="detailContent">content</p>
			</div>
		</div>
		<script src="js/mui.min.js"></script>
		<script type="text/javascript" charset="utf-8">  
			// 所有方法都放到这里
			mui.plusReady(function(){
				window.addEventListener('newsId', detailItemHandler);
			});
			
			// 展示待办事项
			function detailItemHandler(event){   
				var id = event.detail.id;
				 
				 mui.ajax('http://029sj.cn/api.php?s=/News/info/',{
					data:{
						id:id  
					},
					dataType:'json',			//服务器返回json格式数据
					type:'get',			//HTTP请求类型
					success:function(data){
					 	 
						$('#detailTitle').text(data.msg.title);
						$('#detailContent').html(data.msg.content);
					},
					error:function(xhr,type,errorThrown){ 
						//异常处理；
						console.log(type);
					}
				});   
			}
				
				 
		</script>
		<!-- jquery -->
		<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
	</body>
</html>